package cn.wangzg.course0402;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Time: 2020/3/12
 * Author: wangzhiguo
 * Description: 功能描述
 */
public class Person implements Parcelable {
    private String id;
    private String name;
    private String gender;

    public Person(){}

    public Person(String id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
    }

    protected Person(Parcel in) {
        this.id=in.readString();
        this.name=in.readString();
        this.gender=in.readString();
    }

    public static final Creator<Person> CREATOR = new Creator<Person>() {
        @Override
        public Person createFromParcel(Parcel in) {
            return new Person(in);
        }

        @Override
        public Person[] newArray(int size) {
            return new Person[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(name);
        dest.writeString(gender);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }
}
